package com.fishingwithme.domain.spots;

import com.fishingwithme.domain.common.Location;
import cn.fishingwithme.infrastructure.dtos.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fishingwithme.infrastructure.dtos.*;

import java.util.List;

public interface SpotService {
    Spot addSpot(SpotDto spot);

    SpotProps getProps();

    List<SpotDashboardDto> getAllSpotsByLocation(Location location, Integer distance);

    List<SpotDashboardDto> selectMySpotsByLocationAndDistance(Location location, Integer distance);

    SpotDetailDto getSpot(Long spotId);

    UserSpotDto getSpot();

    UserSpotDto getUserSpot(Long spotId);


    void collectSpot(Long spotId);

    VisitHarvestDto addVisitHarvest(VisitHarvestDto dto);

    IPage<SpotHarvestDto> getSpotHarvests(Integer pageNum, Integer pageSize, Long spotId);

    SpotNavDto getSpotNavLineById(Long spotId);

    List<SpotQueryResDto> searchSpots(SpotQueryDto dto);

    IPage<SpotQueryResDto> listCollectedSpots(Integer pageNum, Integer pageSize);


    IPage<SpotPageDto> getCollectedSpots(Long userId, Boolean isCollected, Integer pageNum, Integer pageSize);

    /**
     * 获取公开的收藏钓点列表（无需用户ID）
     *
     * @param isCollected 是否已收藏
     * @param pageNum 页码
     * @param pageSize 每页数量
     * @return 分页钓点列表
     */
    IPage<SpotCollectPageDto> getPublicCollectedSpots(Boolean isCollected, Long spotId , Integer pageNum, Integer pageSize);

    IPage<SpotVisitHisDto> getSpotVisitHis(Integer pageNum, Integer pageSize, Long spotId);

    DTO<Boolean> checkSpotExists(Location location,Integer distance);

    SpotEnhanceDto getUpdateSpot(Long spotId);

    void updateSpot(FishingSpotUpdateDto dto);

    List<SpotDashboardDto> selectSecretSpotsByLocationAndDistance(Location location, Integer distance);

    SpotHarvestDto getSpotHarvest(Long id);


    Boolean harvestLikes(String type, Long harvestId);

    Boolean harvestDislike(String type, Long targetId);

    List<SearchResponseDto> search(String queryStr, String cityCode);

    /**
     * 分页查询钓点列表，支持动态条件
     *
     * @param pageNum 页码
     * @param pageSize 每页数量
     * @param isFree 是否收费
     * @param cityCode 城市代码
     * @param isPrivate 是否秘密钓点
     * @param isForbidden 是否禁止钓鱼
     * @param query 钓点名称模糊查询
     * @return 分页钓点列表
     */
    IPage<SpotListDto> listSpots(Integer pageNum, Integer pageSize, Boolean isFree, String cityCode, Boolean isPrivate, Boolean isForbidden, String query);

    /**
     * 启用/禁用钓点
     *
     * @param spotId 钓点ID
     * @param disabled 是否禁用(true=禁用,false=启用)
     */
    void toggleSpotStatus(Long spotId, Boolean disabled);
}
